import axios from 'axios'
import qs from 'qs';
import {Toast, Indicator} from 'mint-ui';



axios.interceptors.response.use(
  response => {
    let {data: json} = response
    let resp = json
    if(resp) return resp;
    // code == -6 异地登录
    // throw new Error(resp.respDesc)
  },
  error => {
    return Promise.reject(error)
  },
)

export function post(url,data) {
  console.log('url',url);
  console.log('data',data);
  return axios({
    url: url ,
    method: 'POST',
    data:data,
    headers: {
      'AppId': 'com.smk.test.test',
      'Content-Type':'application/x-www-form-urlencoded'
  }
  })

}